use abi_def::{cat_eat, cat_jump, Cat, Food};
use abi_macro::api_impl;

struct BlackCat;

// There is only one black cat in the world.
#[api_impl]
impl Cat for BlackCat {
    fn eat(food: Food) -> usize {
        println!("black cat eat one");
        food.count - 1
    }
}

fn main() {
    let food = Food { count: 3 };
    println!("There are {} food", food.count);

    let left = cat_eat(food);

    println!("food left: {}", left);

    // default function
    let j = cat_jump();

    println!("jump: {}", j);
}
